 <div class="textcontent">
            <h3 class="title"><?php echo $this->titleString[$this->id];?></h3>
            <!-- the tabs -->
            <ul class="tabslanguage">
            	<?php foreach($this->data as $item)
            	{
        			echo "<li><a href='#'>{$item['title']}</a></li>\n";
            	}
            	?>
            </ul>
			<div class="messagebox" style="display:none">
            	<p>Lỗi phát sinh hiện lên ngay đây</p>
            	<p>Lưu không thành công</p>                
            </div>
<!-- tab "panes" -->
<div class="panes">
<!-- Bat dau lap -->
	<?php foreach ($this->data as $item):?>
	<div> 
   	  <form name="mainForm_<?php echo $item['key']; ?>" id="mainForm_<?php echo $item['key']; ?>" method="post" action="">
	            <table class="tblnhaplieu">
                	<tr>
                    	<td width="120px" align="right">Tiêu đề nội dung:</td>
                        <td width="15px" align="center"><span style="color:#900">*</span></td>
                        <td><input name="contents_title_<?php echo $item['key']?>" value="<?php echo $item['contents_title'];?>" type="text" size="50" /></td>
                    </tr>
<!--                    <tr>
                    	<td width="120px" align="right">Hình ảnh:</td>
                        <td width="15px" align="center">&nbsp;</td>
                        <td><img width="120px" id="contents_image_show_<?php echo $item['key']?>" src="<?php echo $item['contents_img'];?>" style="display:none"/>
                        <input type="text" disabled="disabled" name="contents_image_<?php echo $item['key']?>" value="<?php echo $item['contents_img'];?>" id="contents_image_<?php echo $item['key']?>" size="50" />
                        <input type="button" class="image_browser" rel='<?php echo $item['key']; ?>' value="Duyệt trên máy chủ">
                        </td>
                    </tr>-->
<!--                     <tr>
                    	<td width="120px" align="right">Mô tả ngắn:</td>
                        <td width="15px" align="center">&nbsp;</td>
                        <td><textarea name="contents_short_des_<?php echo $item['key']?>" rows="5" cols="70"><?php echo $item['contents_short_des'];?></textarea></td>
                    </tr>-->
                    <tr>
                    	<td width="120px" align="right">Nội dung chi tiết:</td>
                      <td width="15px" align="center">&nbsp;</td>
                        <td>
                        	<?php echo $this->editor("contents_des_".$item['key'],$item['contents_des'],'vi');?>
                        </td>
                    </tr>
<!--                    <tr>
                    	<td width="120px" align="right">Trạng Thái:</td>
                      <td width="15px" align="center">&nbsp;</td>
                        <td>
                        	<?php
                        	$value = array(
                        		'1' => ' Hiện Thị',
                        		'0' => ' Tạm Khóa'
                        	); 
                        	$choose = $item['contents_status']==""?"1":$item['contents_status'];
                        	echo $this->formRadio("contents_status_{$item['key']}",$choose,null,$value," - ");?>
                          	<input type="radio" checked="checked" name="contents_status_<?php echo $item['key']?>" value="1" /> Hiện Thị 
                        	<input name="contents_status_<?php echo $item['key']?>" type="radio" value="0" /> Tạm khóa
                        	
                        </td>
                    </tr>-->
                    <tr>
                    	<td width="120px" align="right"></td>
                        <td width="15px" align="center"><span style="color:#900"></span></td>
                        <td><input type="button" class="btn" value="Lưu thông tin" rel="<?php echo $item['key']?>" /></td>
                    </tr>
                </table>
        </form>
    </div>
	<?php endforeach;?>
	<!-- Ket Thuc -->
</div>
</div>
<?php echo $this->ckfinderPopupInit();?>
<?php $this->headScript()->captureStart() ?>
	$.ajaxSetup ({
   	 	cache: false
	});
	$(document).ready(function(){
			
		$("ul.tabslanguage").tabs("div.panes > div");
		
		//Xy ly image Anh
		$(".image_browser").click(function(){
				var lg = $(this).attr('rel');  
				BrowseServer('Images:/','contents_image_'+lg,'contents_image_show_'+lg);
		});
		<?php foreach ($this->data as $item):?>
			<?php if (!empty($item['contents_img'])):?>
				$("#contents_image_show_<?php echo $item['key']?>").css('display','block');
			<?php endif;?>
		<?php endforeach;?>
		//Xy ly luu
		$(".btn").click(function(){
			var lg = $(this).attr('rel');
			$.post(
		  		'<?php echo $this->baseUrl()."/thongtinchung/save-ajax"?>',
		  		{
		  			'contents_title':$('input[name=contents_title_'+lg+']:text').val(),
		  			'contents_image':$('input[name=contents_image_'+lg+']:text').val(),
		  			'contents_short_des':$('textarea[name=contents_short_des_'+lg+']').val(),
		  			'contents_des':$('#contents_des_'+lg).val(),
		  			'contents_status':$('input[name=contents_status_'+lg+']:radio:checked').val(),
		  			'lang':lg,
		  			'id':'<?php echo $this->id;?>'
		  		}
		  		,
		  		function(data) {
		  			alert(data);
		  		},
		  	    "html"
		  	);
		});
                //Du lieu Mau
		$(".datadefault_ckeditor").click(function(){
                        var apiTmp = $(this).attr('rel');
			var fileName = $(this).attr('rel')+'<?php echo $this->id;?>';
			$.post(
				'<?php echo $this->baseUrl()."/thongtinchung/getsampledata"?>',
				{
					'filename' : fileName
				},
				function(data){
					var apiFunction = "api_"+apiTmp+".setData(data.replace(/\"/g,'\\\"'))";
					eval(apiFunction);
				}
			);
		});
	});
	
	
<?php $this->headScript()->captureEnd() ?>